from person import *


def get_family():

    One = Person('贾母', '女', '1000-01-01', '已婚', '贾府', 'tel111', 'qq111', '伊妹儿111', None)
    family = [One]

    with open('family.txt', 'r', encoding='utf-8') as file1:
        str1 = file1.read()

    list1 = str1.split('\n-----\n')

    for i in list1:
        j = i.split('\n')
        family.append(Person(j[0], j[1], j[2], j[3], j[4], j[5], j[6], j[7], j[8]))

    for i in family:
        for j in family:
            if i.father == j.name:
                i.father = j
                j.kids.append(i)
    return family
